package org.unisannio.db;

import java.io.Serializable;

import javax.persistence.*;

@Entity
@Table(name="Peer", catalog="Services")
public class EntityPeer implements Serializable{
	
	private String mac;
	private String ip;
	private String port;
	private EntityService service;
	
	@Id
	@Column(name="Mac", unique=true, length=17)
	public String getMac() {
		return mac;
	}
	public void setMac(String mac) {
		this.mac = mac;
	}
	
	
	@Column(name="Ip", length=16)
	public String getIp() {
		return ip;
	}
	public void setIp(String ip) {
		this.ip = ip;
	}
	
	
	@Column(name="Port", length=5)
	public String getPort() {
		return port;
	}
	public void setPort(String port) {
		this.port = port;
	}
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name="Service_Uri")
	public EntityService getService() {
		return service;
	}
	public void setService(EntityService service) {
		this.service = service;
	}

}
